<#include "/default/utils/ui.ftl"/>
<@layout "修改用户信息">

<div class="panel panel-default stacked">
	<div class="panel-heading">
		<ul class="nav nav-pills account-tab">
			<li class="active"><a href="profile">基本信息</a></li>
			<li><a href="avatar">修改头像</a></li>
			<li><a href="password">修改密码</a></li>
		</ul>
	</div>
	<div class="panel-body">
		<div id="message">
		<#include "/default/inc/action_message.ftl"/>
		</div>
		<div class="tab-pane active" id="profile">
			<form id="pf" action="profile" method="post" class="form-horizontal">
                <div class="form-group">
                    <label class="control-label col-lg-3" for="nickname">账号</label>
                    <div class="col-lg-4">
                        <span class="form-control" style="border: 0px solid #ccc">${view.username}</span>
                    </div>
                </div>
				<div class="form-group">
					<label class="control-label col-lg-3" for="nickname">昵称</label>
					<div class="col-lg-4">
						<input type="text" class="form-control" name="name" value="${view.name}" maxlength="7" data-required>
					</div>
				</div>
                <div class="form-group">
                    <label class="control-label col-lg-3" for="nickname">地址</label>
                    <div class="col-lg-2">
						<select class="form-control" id="o_province" name="province" onchange="changedata(2,this)">
							<#list cityList as city>
								<#if view.province==city.id>
									<option value="${(city.id)!}" selected>${(city.name)!}</option>
								<#else>
									<option value="${(city.id)!}">${(city.name)!}</option>
								</#if>
							</#list>
						</select>
                    </div>
                    <div class="col-lg-2">
                        <select class="form-control" id="o_city" name="city" onchange="changedata(1,this)">
							<#list twoList as city>
								<#if view.city==city.id>
									<option value="${(city.id)!}" selected>${(city.name)!}</option>
								<#else>
									<option value="${(city.id)!}">${(city.name)!}</option>
								</#if>
							</#list>
                        </select>
                    </div>
                    <div class="col-lg-2">
                        <select class="form-control" id="o_location" name="location">
							<#list threeList as city>
								<#if view.location==city.id>
									<option value="${(city.id)!}" selected>${(city.name)!}</option>
								<#else>
									<option value="${(city.id)!}">${(city.name)!}</option>
								</#if>
							</#list>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-lg-3" for="nickname"></label>
                    <div class="col-lg-4">
                        <input type="text" class="form-control" name="address" value="${view.address}" maxlength="7" data-required placeholder="填写小区名称">
                    </div>
                    <div class="col-lg-3" style="padding-top: 6px;">
                        <span class="label label-warning">方便查找社区发布的信息哦</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-lg-3" for="mobile">电话号码</label>
                    <div class="col-lg-2">
                        <input type="text" id="mobile_value" class="form-control" name="mobile" placeholder="输入您的手机号码" value="${view.mobile}" maxlength="11" data-required>
                    </div>
                    <div class="col-lg-2">
                        <button type="button" id="sendMsgCode" class="btn btn-primary">发送短信验证码</button>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-lg-3" for="valideCode">手机验证码</label>
                    <div class="col-lg-4">
                        <input type="text" id="valide_Code" class="form-control" name="valideCode" placeholder="输入您的手机验证码" maxlength="4" data-required>
                    </div>
                </div>
				<#--<div class="form-group">-->
					<#--<label class="control-label col-lg-3" for="email">邮箱地址</label>-->
					<#--<div class="col-lg-4">-->
						<#--<span class="form-control" style="border: 0px solid #ccc">${view.email}</span>-->
					<#--</div>-->
					<#--<div class="col-lg-3" style="padding-top: 6px;">-->
						<#--<#if (view.activeEmail == 1)>-->
							<#--<span class="label label-success">已验证</span>-->
						<#--<#else>-->
							<#--<span class="label label-warning">未验证</span>-->
						<#--</#if>-->
						<#--<a href="${base}/user/email">修改邮箱</a>-->
					<#--</div>-->
				<#--</div>-->
				<div class="form-group">
					<label class="control-label col-lg-3" for="nickname">个性签名</label>
					<div class="col-lg-6">
						<textarea name="signature" class="form-control" rows="3" maxlength="128">${view.signature}</textarea>
					</div>
				</div>

				<div class="form-group">
					<div class="text-center">
						<button type="submit" class="btn btn-primary">提交</button>
					</div>
				</div><!-- /form-actions -->
			</form>
		</div>
	</div><!-- /panel-content -->
</div><!-- /panel -->

<script type="text/javascript">
$(function () {
	$('#pf').validate({
		onKeyup : true,
		onChange : true,
		eachValidField : function() {
			$(this).closest('div').removeClass('has-error').addClass('has-success');
		},
		eachInvalidField : function() {
			$(this).closest('div').removeClass('has-success').addClass('has-error');
		}
	});
});
</script>
<script src="/static/default/js/modules/profile.js"></script>
</@layout>